<html>
<head>
<title>log-level</title>

<script type="text/javascript">
    if(""!=location.search){ // 将参数清除掉
        location.href="log-level";
    }

    var updateLogLevel = function(logger, level){
        document.getElementById("update_logger").value = logger;
        document.getElementById("update_level").value = level;
        document.getElementById('update_form').submit();
    }
</script>
</head>
<body>
    <form style="display:'none' " id="update_form" action="log-level" method="POST">
        <input type="hidden" id="update_logger" name="update_logger"/>
        <input type="hidden" id="update_level" name="update_level"/>
    </form>

    <#if !(logLevels??) || logLevels?size lt 1 >
    <h2>logLevels 列表为空</h2>
    <#else>
    <table border="1">
        <tr>
            <td></td>
            <td>type</td>
            <td>logger</td>
            <td>additivity</td>
            <td>appenders</td>
            <td>level</td>
        </tr>
        <#list logLevels as logLevel>
            <tr>
            <td>${logLevel_index + 1}</td>
            <td>${logLevel.type!}</td>
            <td>${logLevel.logger}</td>
            <td>${logLevel.additivity?c}</td>
            <td> <#list logLevel.appenderNames as appender>[${appender}]</#list> </td>
            <td>
                <select onchange="updateLogLevel('${logLevel.logger}', this.value);">
                    <#list ["ALL", "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "OFF"] as level>
                        <option <#if (logLevel.level?? && level == logLevel.level) > selected="selected" </#if>>${level}</option>
                    </#list>
                </select>
                </td>
            </tr>
        </#list>
    </table>
    </#if>
</body>
</html>